﻿<UserControl x:Class="LoginManagerLibrary.LoginControl"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" FontSize="20"
             d:DesignHeight="300" d:DesignWidth="300">
    
    <UserControl.Resources>
      
    </UserControl.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="10"></RowDefinition>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition Height="4"></RowDefinition>
            <RowDefinition MinHeight="30" Height="Auto"></RowDefinition>
            <RowDefinition Height="10"></RowDefinition>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition Height="4"></RowDefinition>
            <RowDefinition MinHeight="30" Height="Auto"></RowDefinition>

            <RowDefinition Height="10"></RowDefinition>
            <RowDefinition MinHeight="30" Height="Auto"></RowDefinition>
            <RowDefinition Height="14"></RowDefinition>
        </Grid.RowDefinitions>
        
        <Grid.ColumnDefinitions>
            <ColumnDefinition MaxWidth="10"></ColumnDefinition>
            <ColumnDefinition MaxWidth="60"></ColumnDefinition>
            <ColumnDefinition MaxWidth="250"></ColumnDefinition>
            <ColumnDefinition MaxWidth="10"></ColumnDefinition>
        </Grid.ColumnDefinitions>
        
        <TextBlock Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="2" Text="User Name"  VerticalAlignment="Bottom" ></TextBlock>
        <TextBox Grid.Row="3" Grid.Column="1" Grid.ColumnSpan="2" 
                 Text="{Binding UserName, ValidatesOnDataErrors=True, ValidatesOnExceptions=True,
            ValidatesOnNotifyDataErrors=True}" />

        <TextBlock Grid.Row="5" Grid.Column="1" Grid.ColumnSpan="2" Text="Password"  VerticalAlignment="Bottom" ></TextBlock>
        <PasswordBox x:Name="passwordControl" Grid.Row="7" Grid.Column="1" Grid.ColumnSpan="2"
                     />

        <Button Grid.Row="9" Grid.Column="1" Content="Login"  MaxWidth="60" HorizontalAlignment="Left" 
               Command="{Binding LoginCommand}" CommandParameter="{Binding ElementName=passwordControl}" />
        
    </Grid>
</UserControl>
